package com.ourteam.product.requirement.domain;
/**
 * Template Name : DTO数据对象 Template Version : 1 Template Last Modfiy Date : Fri Nov 30 16:49:33 CST
 * 2018 Auto Generate Date : 2018-12-11 15:24:14 Warning ! This file will be overwrite when
 * regenerate !
 */
import java.util.HashMap;
import java.util.Map;
import net.dao.IDataPopulateCallback;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

public class ProductRoleDefineBean implements java.io.Serializable {

  private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

  private com.ourteam.product.requirement.dao.ProductRoleDefine productRoleDefine;

  protected BeanMap getBeanMap() {

    return new BeanMap(productRoleDefine);
  }

  static {
    mappedDaoFields.put("id", com.ourteam.product.requirement.dao.IProductRoleDefineDAO.Id);

    mappedDaoFields.put(
        "productDefineId",
        com.ourteam.product.requirement.dao.IProductRoleDefineDAO.ProductDefineId);

    mappedDaoFields.put(
        "roleCode", com.ourteam.product.requirement.dao.IProductRoleDefineDAO.RoleCode);

    mappedDaoFields.put(
        "roleName", com.ourteam.product.requirement.dao.IProductRoleDefineDAO.RoleName);

    mappedDaoFields.put("status", com.ourteam.product.requirement.dao.IProductRoleDefineDAO.Status);

    mappedDaoFields.put(
        "remarks", com.ourteam.product.requirement.dao.IProductRoleDefineDAO.Remarks);

    mappedDaoFields.put(
        "productDefineName",
        com.ourteam.product.requirement.dao.IProductRoleDefineDAO.ProductDefineName);

    mappedDaoFields.put(
        "productDefineStatus",
        com.ourteam.product.requirement.dao.IProductRoleDefineDAO.ProductDefineStatus);

    mappedDaoFields.put(
        "productDefineCode",
        com.ourteam.product.requirement.dao.IProductRoleDefineDAO.ProductDefineCode);
  }

  public static String getMappedDAOField(String aAttrName) {
    return mappedDaoFields.get(aAttrName);
  }

  public ProductRoleDefineBean() {
    super();

    this.productRoleDefine = new com.ourteam.product.requirement.dao.ProductRoleDefine();
  }

  public ProductRoleDefineBean(
      com.ourteam.product.requirement.dao.ProductRoleDefine productRoleDefine) {
    super();

    this.productRoleDefine = productRoleDefine;
  }

  public com.ourteam.product.requirement.dao.ProductRoleDefine convertToProductRoleDefine() {
    return this.productRoleDefine;
  }

  public com.ourteam.product.requirement.dao.ProductRoleDefine convertTo() {
    return this.productRoleDefine;
  }

  /**
   * Get id
   *
   * @return long
   */
  public long getId() {
    return (long) this.productRoleDefine.getId();
  }

  /**
   * Set id
   *
   * @parameter long
   */
  public void setId(long id) {

    this.productRoleDefine.setId(id);
  }

  /**
   * Get productDefineId
   *
   * @return long
   */
  public long getProductDefineId() {
    return (long) this.productRoleDefine.getProductDefineId();
  }

  /**
   * Set productDefineId
   *
   * @parameter long
   */
  public void setProductDefineId(long productDefineId) {

    this.productRoleDefine.setProductDefineId(productDefineId);
  }

  /**
   * Get roleCode
   *
   * @return String
   */
  public String getRoleCode() {
    return (String) this.productRoleDefine.getRoleCode();
  }

  /**
   * Set roleCode
   *
   * @parameter String
   */
  public void setRoleCode(String roleCode) {

    this.productRoleDefine.setRoleCode(roleCode);
  }

  /**
   * Get roleName
   *
   * @return String
   */
  public String getRoleName() {
    return (String) this.productRoleDefine.getRoleName();
  }

  /**
   * Set roleName
   *
   * @parameter String
   */
  public void setRoleName(String roleName) {

    this.productRoleDefine.setRoleName(roleName);
  }

  /**
   * Get status
   *
   * @return String
   */
  public String getStatus() {
    return (String) this.productRoleDefine.getStatus();
  }

  /**
   * Set status
   *
   * @parameter String
   */
  public void setStatus(String status) {

    this.productRoleDefine.setStatus(status);
  }

  /**
   * Get remarks
   *
   * @return String
   */
  public String getRemarks() {
    return (String) this.productRoleDefine.getRemarks();
  }

  /**
   * Set remarks
   *
   * @parameter String
   */
  public void setRemarks(String remarks) {

    this.productRoleDefine.setRemarks(remarks);
  }

  /**
   * Get productDefineName
   *
   * @return String
   */
  public String getProductDefineName() {

    return (String) this.productRoleDefine.getProductDefineName();
  }

  /**
   * Get productDefineStatus
   *
   * @return String
   */
  public String getProductDefineStatus() {

    return (String) this.productRoleDefine.getProductDefineStatus();
  }

  /**
   * Get productDefineCode
   *
   * @return String
   */
  public String getProductDefineCode() {

    return (String) this.productRoleDefine.getProductDefineCode();
  }

  public int hashCode() {
    return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
  }

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } // end if

    if ((obj instanceof ProductRoleDefineBean) == false) {
      return false;
    } // end if

    ProductRoleDefineBean other = (ProductRoleDefineBean) obj;

    boolean isEqual = false;

    com.ourteam.product.requirement.dao.ProductRoleDefine tempProductRoleDefine =
        other.convertToProductRoleDefine();

    if (tempProductRoleDefine == null || this.productRoleDefine == null) {
      isEqual = false;
    } else if (tempProductRoleDefine == this.productRoleDefine
        || tempProductRoleDefine.equals(this.productRoleDefine)) {
      isEqual = true;
    } else {
      isEqual = false;
    }

    return isEqual;
  }

  public static ProductRoleDefineBean[] toArray(
      com.ourteam.product.requirement.dao.ProductRoleDefine[] aProductRoleDefines) {

    return toArray(aProductRoleDefines, null);
  }

  public static ProductRoleDefineBean[] toArray(
      com.ourteam.product.requirement.dao.ProductRoleDefine[] aProductRoleDefines,
      IDataPopulateCallback aCallBack) {

    if (ArrayUtils.isEmpty(aProductRoleDefines)) {
      return new ProductRoleDefineBean[0];
    }

    int length = aProductRoleDefines.length;

    ProductRoleDefineBean[] beans = new ProductRoleDefineBean[length];

    for (int i = 0; i < length; i++) {
      beans[i] = new ProductRoleDefineBean(aProductRoleDefines[i]);
      if (aCallBack != null) {
        aCallBack.populate(beans[i], new Object[] {aProductRoleDefines[i]});
      }
    }

    return beans;
  }
}
